/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <cstdio>
#include <cstring>
using namespace std;
const int N=101;

int main_1048()
{
    char A[N]={0},B[N]={0};
    char mp[]="0123456789JQK";
    scanf("%s %s",A,B);
    int lenA=strlen(A),lenB=strlen(B),Ax,Bx,diff;
    int n=lenA>lenB?lenA:lenB;
    char C[N]={0};
    for (int i=1;i<=n ;++i )
    {
        Ax=(lenA-i)>=0?(A[lenA-i]-'0'):0;
        Bx=(lenB-i)>=0?(B[lenB-i]-'0'):0;
        if (i%2==1)
        {
            C[n-i]=mp[(Ax+Bx)%13];
        }
        else
        {
            diff=Bx-Ax;
            if (diff<0)
            {
                diff+=10;
            }
            C[n-i]=diff+'0';
        }
    }
    printf("%s",C);
    return 0;
}
